﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace DissipativeInputProcessing
{
    class SingleFileFramePool : FramePool
    {
        public SingleFileFramePool()
            : base()
        {
        }

        public void ReadFramesFromFile(FileInfo fileInfo)
        {
            var newList = new List<IFrame>();
            if (!fileInfo.Exists)
                throw new IOException("Несуществующая директория.");
            Frames = new List<IFrame>();
            var i = 1;
            foreach (var frame in _parser.ParseOneBigFile(fileInfo.FullName))
            {
                Frames.Add(new Frame(frame,"frame"+(i++).ToString()));
            }
        }
    }
}
